const path = require('path')
const { env } = require('process')

module.exports = {
    publicPath: '/comp/',

    devServer: {
        host: '127.0.0.1',
        port: 8099,

        proxy: {
            '/backend': {
                // target: 'http://223.75.53.208:8081',
                // target: 'http://121.36.155.145:10025/',
                target: 'http://8.136.133.77:8081',
                // target: 'http://pope.cn1.utools.club',
                // pathRewrite:{
                    // '^/backend': '/'
                // }
            },
            '/upload':{
                target: 'http://8.136.133.77:8081',
            }
        }
    },
    productionSourceMap: false,
    
    chainWebpack: config => {
        config
            .plugin('html')
            .tap(args => {
                args[0].title = '湖北省流行病学调查平台（内部测试）'
                return args
            })
    },
    configureWebpack: {
        resolve: {
            alias: {
                '@': path.resolve(__dirname, 'src'),
                'com': path.resolve(__dirname, 'src', 'components'),
            }
        },
        externals:{
            'vue': 'Vue',
            'vuex':'Vuex',
            // 'ant-design-vue': 'antd',
            'element-ui': 'ELEMENT',
            'vue-router': 'VueRouter',
            "moment": "moment",
            "md5": "js-md5",
            'axios': 'axios',
            'ol':'ol',
            'vue-grid-layout': 'VueGridLayout',
            '@form-create/element-ui':'formCreate'
            // 'echarts':'echarts',
        },
        module: {

        }
    }
}